package com.example.teamilkmall.service.Impl;

import com.example.teamilkmall.entity.CustomerInfo;
import com.example.teamilkmall.mapper.CustomerInfoMapper;
import com.example.teamilkmall.service.CustomerInfoService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author czl
 * @Date 2025-01-07
 */
@Service
public class CustomerInfoServiceImpl implements CustomerInfoService {

    private final CustomerInfoMapper customerInfoMapper;

    public CustomerInfoServiceImpl(CustomerInfoMapper customerInfoMapper) {
        this.customerInfoMapper = customerInfoMapper;
    }

    @Override
    public PageInfo<CustomerInfo> listCustomerInfo(Integer pageSize, Integer pageNum, String name) {
        List<CustomerInfo> list = customerInfoMapper.listCustomerInfo(pageSize,pageNum,name);
        PageInfo<CustomerInfo> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public List<CustomerInfo> listCustomerInfoAll() {
        return customerInfoMapper.listCustomerInfoAll();
    }

    @Override
    public void updateCustomerInfo(CustomerInfo customerInfo) {
        customerInfoMapper.updateCustomerInfo(customerInfo);
    }

    @Override
    public void deloneCustomerInfo(Integer id) {
        customerInfoMapper.deloneCustomerInfo(id);
    }

    @Override
    public void addCustomerInfo(CustomerInfo customerInfo) {
        customerInfoMapper.addCustomerInfo(customerInfo);
    }
}
